-------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\riley\Dropbox\DialysisAmbulanceFraud\JPE Submission\Final Submission\replication\logs/recoveries.log
  log type:  text
 opened on:  16 Jul 2024, 15:51:17

. 
. /*******************************************************************************
> recoveries.do
> 
> This code reports statistics on recoveries from criminal and civil cases
> *******************************************************************************/
. 
. *Importing recovery data
. import excel "${rawdatapath}RecoveryData_full.xlsx", sheet("Sheet1") firstrow clear
(28 vars, 103 obs)

. drop if missing(TotalPaidRecoveredtoDate)
(76 observations deleted)

. 
. *Getting total paid
. su TotalPaidRecoveredtoDate // Referenced in Section 6.1, Paragraph 2 and Appendix J.2, Bullet 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
TotalPaidR~e |         27     1158242     2017869          0    8106247

. 
. *Getting share of total paid
. egen TotalPaid=total(TotalPaidRecoveredtoDate)

. egen TotalOwed=total(TotalAmountPaidOwed)

. gen TotalPaidShare=TotalPaid/TotalOwed

. list TotalPaidShare if _n==1 // Referenced in Section 6.1, Paragraph 2 and Appendix J.2, Bullet 1

     +----------+
     | Total~re |
     |----------|
  1. | .5129206 |
     +----------+

. 
. *Getting stats on partial/full payments
. gen fullpaid=TotalPaidRecoveredtoDate==TotalAmountPaidOwed

. tab fullpaid // Referenced in Section 6.1, Paragraph 2 and Appendix J.2, Bullet 1

   fullpaid |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |         17       62.96       62.96
          1 |         10       37.04      100.00
------------+-----------------------------------
      Total |         27      100.00

. 
. gen less20=TotalPaidRecoveredtoDate/TotalAmountPaidOwed<0.2

. tab less20 // Referenced in Section 6.1, Paragraph 2 and Appendix J.2, Bullet 1

     less20 |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |         16       59.26       59.26
          1 |         11       40.74      100.00
------------+-----------------------------------
      Total |         27      100.00

. 
. *Getting median close year
. destring CaseClosedYear, replace force
CaseClosedYear: contains nonnumeric characters; replaced as int
(2 missing values generated)

. replace CaseClosedYear=2024 if missing(CaseClosedYear)
(2 real changes made)

. su CaseClosedYear, d // Referenced in Section 6.1, Paragraph 2

                      Case Closed Year
-------------------------------------------------------------
      Percentiles      Smallest
 1%         2008           2008
 5%         2008           2008
10%         2011           2011       Obs                  27
25%         2015           2012       Sum of wgt.          27

50%         2016                      Mean           2016.259
                        Largest       Std. dev.      3.898645
75%         2019           2020
90%         2020           2020       Variance       15.19943
95%         2024           2024       Skewness      -.1791383
99%         2024           2024       Kurtosis       3.182915

. 
. log close
      name:  <unnamed>
       log:  C:\Users\riley\Dropbox\DialysisAmbulanceFraud\JPE Submission\Final Submission\replication\logs/recoveries.log
  log type:  text
 closed on:  16 Jul 2024, 15:51:17
-------------------------------------------------------------------------------------------------------------------------------------------
